package cn.iocoder.yudao.module.system.dal.mysql.homedata;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.homedata.HomeDataDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.homedata.vo.*;

/**
 * 首页数据 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface HomeDataMapper extends BaseMapperX<HomeDataDO> {

    default PageResult<HomeDataDO> selectPage(HomeDataPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HomeDataDO>()
                .eqIfPresent(HomeDataDO::getType, reqVO.getType())
                .betweenIfPresent(HomeDataDO::getDate, reqVO.getDate())
                .eqIfPresent(HomeDataDO::getValue1, reqVO.getValue1())
                .eqIfPresent(HomeDataDO::getValue2, reqVO.getValue2())
                .eqIfPresent(HomeDataDO::getValue3, reqVO.getValue3())
                .eqIfPresent(HomeDataDO::getValue4, reqVO.getValue4())
                .eqIfPresent(HomeDataDO::getValue5, reqVO.getValue5())
                .eqIfPresent(HomeDataDO::getValue6, reqVO.getValue6())
                .eqIfPresent(HomeDataDO::getValue7, reqVO.getValue7())
                .eqIfPresent(HomeDataDO::getValue8, reqVO.getValue8())
                .eqIfPresent(HomeDataDO::getValue9, reqVO.getValue9())
                .eqIfPresent(HomeDataDO::getValue10, reqVO.getValue10())
                .betweenIfPresent(HomeDataDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HomeDataDO::getId));
    }

}